package top.itbook.util;

/**
 * 这个工具类提供了Java程序运行时环境的查询方法
 */
public class Run {
    private static final Runtime RUNTIME = Runtime.getRuntime(); // java程序关联的运行时对象
    public static void getINFO(){
        System.out.println("处理器核心数量：" + RUNTIME.availableProcessors());
        System.out.println("空闲内存：" + RUNTIME.freeMemory() / 1024 / 1024 + "MB");
        System.out.println("总内存：" + RUNTIME.totalMemory() / 1024 / 1024 + "MB");
        System.out.println("最大可用内存：" + RUNTIME.maxMemory() / 1024 / 1024 + "MB");
    }
}
